package com.hl.yyx.modules.ums.controller;

import com.hl.yyx.common.log.LogAnnotation;
import com.hl.yyx.common.response.ObjectResponse;
import com.hl.yyx.common.response.Response;
import com.hl.yyx.common.vo.PageParamsDTO;
import com.hl.yyx.dto.IdDTO;
import com.hl.yyx.modules.ums.service.UmsOperationLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 操作日志 前端控制器
 * </p>
 *
 * @author hl243695czyn
 * @since 2025-03-27
 */
@RestController
@RequestMapping("/admin/operation-log")
@Api(tags = "操作日志管理", description = "操作日志管理")
public class UmsOperationLogController {
    @Autowired
    private UmsOperationLogService umsOperationLogService;

    // 分页
    @LogAnnotation()
    @ApiOperation("分页查询")
    @PostMapping(value = "/page")
    public Response page(@RequestBody PageParamsDTO pageParamsDTO) {
        Response pageList = umsOperationLogService.pageList(pageParamsDTO);
        return new ObjectResponse<>(pageList);
    }

    // 查看
    @LogAnnotation()
    @ApiOperation("查看")
    @PostMapping(value = "/view")
    public Response view(@RequestBody IdDTO idDTO) {
        Response data = umsOperationLogService.view(idDTO);
        return new ObjectResponse<>(data);
    }
}

